﻿/**
 * @file tst_demo.cpp
 * @author huangxb
 * @email 18228033207@163.com
 * @date 2024.04.27
 * @license MIT License
 * @brief 学习使用QTest进行单元测试.
 *
 * @htmlonly
 * <span style="font-weight: bold">History</span>
 * @endhtmlonly
 * Version|Auther|Date|Describe
 * ------|----|------|--------
 * V1.0|huangxb|2024.04.27|创建
 */
/* 自定义头文件 */
#include "tst_demo.h"
/* 库头文件 */
#include <QtTest>
#include <QDebug>

void CDemoTest::initTestCase()
{
    qDebug() << "初始化：运行一次";
}

void CDemoTest::cleanupTestCase()
{
    qDebug() << "清理资源：运行一次";
}

void CDemoTest::init()
{
    qDebug() << "每个case初始化";
}

void CDemoTest::cleanup()
{
    qDebug() << "每个case清理资源";
}

void CDemoTest::test_case()
{
    qDebug() << "test_case";
    QString name("hello");

    QCOMPARE(name, "hello");
}

void CDemoTest::test_case2()
{
    qDebug() << "test_case2";
    QString name("hello");
    QCOMPARE(name, "hello");
}
